<%@ page import="cn.kongwg.pojo.Person" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/1/23
  Time: 21:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    Person person=new Person();
    person.setName("到底要不要面试！");
    person.setPhones(new String[]{"18335964285","18335964285","18359642785"});

    List<String> cities=new ArrayList<String>();
    cities.add("北京");
    cities.add("上海");
    cities.add("深圳");
    person.setCities(cities);

    Map<String,Object> map=new HashMap<>();
    map.put("key1","value1");
    map.put("key2","value2");
    map.put("key3","value3");person.setMap(map);
    pageContext.setAttribute("p",person);
    pageContext.setAttribute("req",request);
%>

${p.name}<br>
${p.phones[0]}<br>
${p.cities[1]}<br>
${p.map.key1}<br>
${pageContext.request.serverName}<br>

1.协议： ${ req.scheme }<br>
2.服务器ip：${ pageContext.request.serverName }<br>
3.服务器端口：${ pageContext.request.serverPort }<br>
4.获取工程路径：${ pageContext.request.contextPath }<br>
5.获取请求方法：${ pageContext.request.method }<br>
6.获取客户端ip地址：${ pageContext.request.remoteHost }<br>
7.获取会话的id编号：${ pageContext.session.id }<br>
</body>
</html>
